rgplates

R interface for the GPlates Web Service and the GPlates Application

Ádám T. Kocsis, John Cannon, Xiaodong Qin, Dietmar Müller, Nussaibah B. Raja, Simon Williams, Sabin Zahirovic, Elizabeth M. Dowding

FAU GeoZentrum Nordbayern, EarthByte Group - University of Sydney, University of Tasmania

Overview

  1. Introduction: why is this necessary?
  2. Feature set: what can you do?
  3. Implementation: some details
    • Overview
    • Project history
    • Resources
  4. Practical demonstration

Goal: an overview of the project and its utility in the paleoecological R toolset.

1. Introduction

Paleo has gone into ‘space’

  • First data compilations were focusing on stratigraphy
  • Dominant research direction (since 2000s)
  • Because we now know where fossils are

In paleoecological research…

Spatial structure of sampling

Close et al. (2020)

Latitudinal gradients

Zhang, Shen, and Erwin (2022)

In paleoecological research

Niche modeling

Saupe et al. (2019)

Range assessment

Darroch et al. (2022)

In paleoecologcial research

Understanding extinctions

Penn et al. (2018)

Bioregionalization

Kocsis, Reddin, and Kiessling (2018)

Paleogeographic reconstructions

  • Most such research use reconstruction data products →
  • DEMs, GCMs, ESMs (e.g. Scotese and Wright (2018), Valdes et al. (2017))
  • All are built on tectonic models

Tectonic models disagree…

… the deeper we go in time.

Buffan et al. (2023)

Tectonic calculations in the R toolchain

  • How does this tectonic model variable create error in ecological results?
  • Documentation of tectonic model use can be cryptic. Redo rotations yourself?
  • High-level, easy-to-use, fully flexible and robust solution
  • Abstraction allows higher complexity!

Integrate tectonic reconstruction into all analytical pipelines

2. Feature set

Make maps: exploration of tectonic models

  • Use a tectonic model: reconstruct feature collections

Visualize spatial distribution of records

Compare tectonic models (Devonian)

Use derived data products (PALEOMAP, Campanian)

Pre-defined shapes: static_polygons

  • Most basic components of the model
  • Vary depending on the model (e.g. oceanic plates included?)

Example

plates <- reconstruct("static_polygons", age=65, model="MERDITH2021")
plot(plates$geometry, col="gray", border="black")

Pre-defined elements: coastlines (GWS)

  • NOT paleocoastlines!
  • Modern landmassess partitioned with the static_polygons
  • Useful for orientation, i.e. where are things on a map?

Example

coast <- reconstruct("coastlines", age=65, model="MERDITH2021")
plot(coast$geometry, col="gray", border="black")

Paleocoordinates of present-day localities

  • input: 2-column matrix of present-day geographic coordinates (longitude/latitude)
  • The workhorse of rgplates
  • Works because of partitioning polygons (default: static_polygons)
# longitude-latitude coordinates
sydney<- c(151.17, -33.85)
montreal<- c(-73.61, 45.52)

# 2-column matrix 
x <- rbind(sydney, montreal)
colnames(x) <- c("long", "lat")
x
           long    lat
sydney   151.17 -33.85
montreal -73.61  45.52
reconstruct(x, age=106.85, model="MERDITH2021")
         paleolong paleolat
sydney    163.5807 -66.8277
montreal  -20.0174  42.8810

Paleocoordinate transformation (GWS)

  • Using paleocoordinates as input, i.e. those derived from spatial calculations in past space
  • Tracing evolution ares that have relevance (e.g. sampling)
  • Spatial simulations
randomPoints65 <- reconstruct(randomPoints107,
    from=107, age=65)

Reconstruction of complex spatials - In development

Vector spatials (sf)

Present-day 10-degree graticules reconstructed (MERDITH2021 at 65Ma)

  • Polygon topology issues (lines work)

Raster spatials (terra)

Reconstructed position of present-day topography (ETOPO1, MERDITH2021 at 65Ma)

  • GWS (relies in paleocoord. input)

More to come!

  • Joint development since autumn 2024, rgplates is now part of the GPlates suite
  • Current feature set prioritized for ecological analyses, but there is lots more, e.g. velocity calculations
velo <- velocities(age=65, model="MERDITH2021", 
  output="SpatRaster")

Liz Dowding

3. Implementation details

Major modules

  • Two major modules: online and offline, pros and cons for both
  • Shared interface: primary differece is how the tectonic model is specified:
    • online: character string (GWS)
    • offline: platemodel S4 class (GPlates file links)

History: first steps

  • Started as part of the chronosphere project (2018)
  • Original purpose: provide easier interface to working with deep-time climate model data
  • We need paleocoordinates for the climate models… manually? How?

Nussaïbah: Use the GPlates Web Service!

Adam: We should use pyGPlates!

Versioned data access API

GWS, really? Via the internet?!

  • Multiple attempts were made to build R tools on the GWS, none were advanced enough to be used as a dependency.
    • Reproducibility?! - People who struggle with R will not like Docker…
  • No control over model version
  • Reconstructing large amounts of data, e.g. the entire Paleobiology Database was not possible

Something faster and local

  • It never became easy to install an R package with a reliable, automatic instance of pyGPlates dependency
  • John Cannon suggested that there is an old, abandoned console interface to the GPlates Application
      1. R exports files to the hard drive
      1. GPlates does its magic
      1. R reads stuff back
  • Access files?

The modularization of the chronosphere

  • All this was part of it, which became a textbook case of feature creep
  • Managable until:
    • R spatial evolution (most code needed to be rewritten)
    • Nuss got a data science job
    • Adam became a faculty member and fell for UNIX

Tectonic modelling, R GPlates API ⟹ rgplates

Current feature coverage (v0.5.0 - not complete!)

Working with Xiaodong Qin and John Cannon to equalize the interface.

Resources and learning!

4. Practical demonstration

Files accessible here: adamkocsis/rgplates_palaeoverse

Thanks!

  • Hundreds of users, especially who provided feedback and continue to support!
  • Deutsche Forschungsgemeinschaft: TERSANE SPex, Ko 5382/2-1

Not happy?Happy!

References

Buffan, Lucas, Lewis A. Jones, Mathew Domeier, Christopher R. Scotese, Sabin Zahirovic, and Sara Varela. 2023. Mind the uncertainty: Global plate model choice impacts deep-time palaeobiological studies.” Methods Ecol. Evol. n/a (n/a). https://doi.org/10.1111/2041-210X.14204.
Close, R. A., R. B. J. Benson, E. E. Saupe, M. E. Clapham, and R. J. Butler. 2020. “The Spatial Structure of Phanerozoic Marine Animal Diversity.” Science 368 (6489): 420–24. https://doi.org/10.1126/science.aay8309.
Darroch, Simon A. F., Erin E. Saupe, Michelle M. Casey, and Maria L. S. P. Jorge. 2022. “Integrating Geographic Ranges Across Temporal Scales.” Trends in Ecology & Evolution, June. https://doi.org/10.1016/j.tree.2022.05.005.
Kocsis, Ádám T., Carl J. Reddin, and Wolfgang Kiessling. 2018. “The Biogeographical Imprint of Mass Extinctions.” Proceedings of the Royal Society B: Biological Sciences 285 (1878): 20180232. https://doi.org/10.1098/rspb.2018.0232.
Penn, Justin L., Curtis Deutsch, Jonathan L. Payne, and Erik A. Sperling. 2018. “Temperature-Dependent Hypoxia Explains Biogeography and Severity of End-Permian Marine Mass Extinction.” Science 362 (6419): eaat1327. https://doi.org/10.1126/science.aat1327.
Saupe, Erin E., Alexander Farnsworth, Daniel J. Lunt, Navjit Sagoo, Karen V. Pham, and Daniel J. Field. 2019. “Climatic Shifts Drove Major Contractions in Avian Latitudinal Distributions Throughout the Cenozoic.” Proceedings of the National Academy of Sciences 116 (26): 12895–900. https://doi.org/10.1073/pnas.1903866116.
Scotese, Christopher R, and Nicky Wright. 2018. PALEOMAP Paleodigital Elevation Models (PaleoDEMS) for the Phanerozoic.” https://www.earthbyte.org/paleodem-resource-scotese-and-wright-2018/.
Valdes, Paul J., Edaward Armstrong, Marcus P. S. Badger, Catherine D. Bradshaw, Fran Bragg, Taraka Davies-Barnard, Jonathan J. Day, et al. 2017. “The BRIDGE HadCM3 Family of Climate Models: HadCM3@Bristol V1.0.” Geoscientific Model Development 10 (February): 3715–43. https://www.geosci-model-dev.net/10/3715/2017/.
Zhang, Shu-Han, Shu-Zhong Shen, and Douglas H Erwin. 2022. “Latitudinal Diversity Gradient Dynamics During Carboniferous to Triassic Icehouse and Greenhouse Climates.” Geology 50 (10): 1166–71.